package com.guoxin.concurrentprogramming.chapter2;

import java.util.concurrent.TimeUnit;

/**
 * @author guoxin
 * @date 2019/7/15
 */
public class JoinMain {
    private static int i = 0;

    public static void main(String[] args) throws InterruptedException {
        System.out.println("main start");
        Thread t = new Thread(() -> {
            System.out.println("t start");
           for(i=0;i<1000000;i++){

           }
            System.out.println("t end");
        });
        t.start();
        t.join();
        System.out.println("main end"+i);
    }
}
